package com.syedu.day01.homework;

/**
 * @Description 点名系统
 * @createTime 2022/3/3 17:36
 * @author Administrator
 */
public class RollCall {
    public static void main(String[] args) {
        String[] names = {"昂志成", "曹家乐", "陈赢", "甘健", "高为建", "顾凌菘", "郭旭", "江鸿辉", "季顺杰", "孔佳桅", "李邦", "李佳旭", "刘瑞", "钱进", "邱宇", "孙忠海", "唐之奇", "滕悦", "童曦煜", "魏铭", "谢俊峰", "叶嘉祺", "袁杰", "章俊", "郑华剑", "钟金超", "邹茂吉", "张健"};
        //获取当前系统时间毫秒数
        long t1 = System.currentTimeMillis();
        for (; ; ) {
            int random = (int) (Math.random() * 28);
            String name = names[random];
            System.out.printf(name + "\r");
            long t2 = System.currentTimeMillis();
            if (t2 - t1 > 5000) {
                System.out.printf("恭喜:" + name + ",中奖了...");
                break;
            }
        }
    }
}